<html>
<head>
	<style>
		<#include "report.css">
	</style>
	<script type="text/javascript">
		<#include "report.js">
	</script>
</head>
<body>

<ul class="controls">
	<li><a href="#" onclick="expandAll();return false;">+ expand all</a></li>
	<li><a href="#" onclick="showPassed();return false;">+ show passed</a></li> 
	<li><a href="#" onclick="showFailed();return false;">+ show failed</a></li>
	<li><a href="#" onclick="collapseAll();return false;">- collapse all</a></li>
</ul>

<#assign testid = 0>
<#assign moduleid = 0>    
<#macro printContainer container>
<#assign moduleid = moduleid + 1>  
<#assign totals = lookupTotals(container.id)>
<a href="#" onClick="toggle('mod${moduleid}');return false;"><h2>${container.name}
<span class="stats">(
	<span class="stats-success">${totals.successCount} ok</span>
	<#if (totals.failedCount > 0)>
	/ <span class="stats-failure">${totals.failedCount} failed</span>
	</#if> )
</span></h2></a>
<div id="mod${moduleid}" class="module">
<#list container.testCases as testCase>
	<@printTestCase testCase/>
</#list>
<#list container.subContainers as child>
	<@printContainer child/>
</#list>
</div>
</#macro>
<#macro printTestCase test>
<#assign testid = testid + 1>
<#assign result = lookupResult(test.id)>    
<div id="t${testid}" class="test ${result.passed?string("test-passed", "test-failed")}">
	<div class="testtitle">
		<span class="indicator-${result.passed?string("success", "failure")}">&nbsp;</span>
		<span>${test.name}</span> (
		<#if result.messages?has_content>
		<a href="#" onClick="toggle('m${testid}');return false;">messages</a>
		</#if>
		<#if test.comments?has_content>
		<a href="#" onClick="toggle('c${testid}');return false;">comments</a>
		</#if>
		<#if result.dataSet.dataAvailable>
			<a href="#" onClick="toggle('d${testid}');return false;">data</a>
		</#if>
		<a href="#" onClick="toggle('s${testid}');return false;">script</a>
		)
	</div>
	<#if result.messages?has_content>
	<div id="m${testid}" class="messages">
		<ul>
		<#list result.messages as message>
		<li>${message}</li>
		</#list>
		</ul>
	</div>
	</#if>	
	<#if test.comments?has_content>
	<div id="c${testid}" class="comments" style="display:none;">
		<ul>
		<#list test.comments as comment>
		<li><b>${comment.commenter}:</b> ${comment.text}</li>
		</#list>
		</ul>
	</div>
	</#if>
	<#if result.dataSet.dataAvailable>
	<div id="d${testid}" class="data" style="display:none;">
		<#list result.dataSet.tables as table> 
		<table>
		<#if table.metaData.columnNames?has_content>
		<tr>
			<#list table.metaData.columnNames as column><th>${column}</th></#list>
		</tr>
		</#if>
		<#list table.rows as row>
		<tr>
			<#list row.values as value><td>${value?if_exists?string}</td></#list>
		</tr>
		</#list>
		</table>
		</#list>
	</div>
	</#if>
		
	<div id="s${testid}" class="script" style="display:none;">
        <pre>${test.testDefinition?trim}</pre>		
	</div>
	
</div>
</#macro>

<@printContainer suite/>
</body>
</html>
